package com.cyf.activemq.service;

import com.cyf.activemq.network.bean.*;
import com.cyf.activemq.network.bean.person.MqSendStatisticalDataReq;
import com.cyf.db.bean.PayOrder;
import com.cyf.service.bean.CustomException;
import com.cyf.smartCity.bean.MqAddUpdatePersonAndCarReq;
import com.cyf.smartCity.bean.MqAddUpdatePersonAndCarRsp;
import com.cyf.smartCity.bean.MqCloseBarrierRsp;
import com.cyf.smartCity.bean.MqOpenBarrierRsp;

import java.util.ArrayList;
import java.util.Date;

/**
 * activemq处理接口：处理：入场通知，出场通知，人管平台的定时发送统计信息等
 * Created by cage on 2017/3/18.
 */
public interface MqService {

    /**
     * 人管平台: 发送统计数据给微信用户
     *
     * @param mqSendStatisticalDataReq 来自TOB的请求信息
     */
    void sendStatisticalDataForPerson(MqSendStatisticalDataReq mqSendStatisticalDataReq);

    /**
     * pmsvr: 发送入场信息给微信、app用户
     *
     * @param mqCarInReq
     */
    void sendCarInInfoForPmsvr(MqCarInReq mqCarInReq);

    /**
     * pmsvr: 发送入场信息给微信、app用户
     *
     * @param mqCarOutReq
     */
    void sendCarOutInfoForPmsvr(MqCarOutReq mqCarOutReq);

    /**
     * 车辆锁定或解锁
     *
     * @param plate      车牌号码
     * @param parkingId  车场id
     * @param lockStatus 锁定状态
     * @return MqCarLockOrNoRsp
     */
    MqCarLockOrNoRsp carLockOrNo(String plate, Integer parkingId, Integer lockStatus) throws CustomException;

    /**
     * 获取停车费用
     *
     * @param plate     车牌号码
     * @param parkingId 车场id
     * @param outTime   出场时间
     * @return MqGetFeeRsp
     */
    MqGetFeeRsp getFee(String plate, Integer parkingId, Date outTime) throws CustomException;

    /**
     * 获取入场车辆计费时的费用描述
     *
     * @param parkingId   车场id
     * @param inParkingId 车场中的入场记录id
     * @return MqGetFeeDescRsp
     */
    MqGetFeeDescRsp getFeeDesc(int parkingId, int inParkingId) throws CustomException;

    /**
     * 月/年卡车过期通知
     *
     * @param mqExpiredWarningReq
     */
    void sendExpiredWarningMsg(MqExpiredWarningReq mqExpiredWarningReq);

    /**
     * 获取费率
     *
     * @param parkingId
     * @param plates
     * @return
     * @throws CustomException
     */
    MqGetFeeRateRsp getFeeRate(Integer parkingId, ArrayList<String> plates) throws CustomException;

    /**
     * 注册会员和车
     *
     * @param mqReq
     * @return
     */
    MqRegPersonAndCarRsp regPersonAndCar(MqRegPersonAndCarReq mqReq) throws CustomException;

    /**
     * 更新会员和车
     *
     * @param mqReq
     * @return
     * @throws CustomException
     */
    MqUpdatePersonAndCarRsp updatePersonAndCar(MqUpdatePersonAndCarReq mqReq) throws CustomException;


    /**
     * 下发优惠券支付结果
     */
    /**
     * 支付订单下发车场(保存支付停车费信息后，向车场下发消息)
     *
     * @param payOrder
     */
    void sendPayOrder(PayOrder payOrder);


    /**
     * 智慧停管平台-注册/更新会员和车辆
     *
     * @param mqReq
     */
    MqAddUpdatePersonAndCarRsp addUpdatePersonAndCar(MqAddUpdatePersonAndCarReq mqReq) throws CustomException;

    /**
     * 开闸
     *
     * @param plate
     * @param parkingId
     * @param deviceId
     * @return
     * @throws CustomException
     */
    MqOpenBarrierRsp openBarrier(String plate, int parkingId, int deviceId, int feeRspId) throws CustomException;


    MqCloseBarrierRsp closeBarrier(int parkingId, int deviceId) throws CustomException;


}
